<?php

class admin_model_system_config extends model
{

	public function save_to_file($obj, $file)
	{
		$vars = get_object_vars($obj);

		$buf = "<?php\r\n";
		$buf .= 'class '.get_class($obj)."\r\n";
		$buf .= "{\r\n";

		foreach($vars as $key=>$val)
		{
		    $val = str_replace('\'', '&#039;', $val);
			$buf .= '  public $'.$key.' = \''.$val.'\';' . "\r\n";
		}
		$buf .= "}\r\n";
		$buf .= '?>';
		
		file_put_contents( $file, $buf );
	
	}

}
?>